<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css"></style>
    <script>
    window.onbeforeunload = function (){
        // alert('ooooooKKKK');
        return "string...";
    }
    </script>
</head>
<body>
    <h1>JS 关闭事件</h1>
    <hr>
    
   
    
    <script>
        
    </script>
</body>
</html>